#include "mysdk.h"

MySDK::MySDK(QObject *parent)
    : QObject{parent}
{}

MySDK *MySDK::getInstance()
{
    static MySDK* obj = new MySDK();
    return obj;
}

void MySDK::deviceInit()
{
    MV_CC_Initialize();
    MV_CC_DEVICE_INFO_LIST deviceList = {0};
    MV_CC_EnumDevices(MV_GIGE_DEVICE, &deviceList);
    void* handle = NULL;
    MV_CC_CreateHandle(&handle, deviceList.pDeviceInfo[0]);
    MV_CC_OpenDevice(handle);
    MV_CC_SetEnumValue(handle, "TriggerMode", 0);
    MV_CC_StartGrabbing(handle);
    GrabThread* grabThread = GrabThread::getInstance();
    grabThread->handle = handle;
    grabThread->start();
}
